package com.od.service.serviceImpl;

import com.od.entity.Interview;
import com.od.mapper.InterviewMapper;
import com.od.service.InterviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Time;
import java.sql.Date;
import java.util.List;
import java.util.Map;

@Service
public class InterviewServiceImpl implements InterviewService {
    @Autowired
    private InterviewMapper interviewMapper;

    @Override
    public List<Interview> getAllInterviews() {
        return interviewMapper.selectAllInterviews();
    }

    @Override
    public List<Interview> selectBySeekerId(String interviewSeeker) {
        return interviewMapper.selectBySeekerId(Integer.parseInt(interviewSeeker));
    }

    @Override
    public int insertInterview(Interview interview) {
        return interviewMapper.insertInterview(interview);
    }

    @Override
    public int deleteById(String interviewId){
        return interviewMapper.deleteById(Integer.parseInt(interviewId));
    }

    @Override
    public  int updateInterview(Interview interview){
        return interviewMapper.updateInterview(interview);
    }

    @Override
    public List<Interview> selectByEnterpriseId(String interviewEnterprise){
        return interviewMapper.selectByEnterpriseId(Integer.parseInt(interviewEnterprise));
    }

    @Override
    public List<Map<String, Object>> getInterviewInfo(String interviewEnterprise) {
        return interviewMapper.selectInterviewInfo(Integer.parseInt(interviewEnterprise));
    }

    @Override
    public List<Map<String, Object>> getInterviewInfoIn(String interviewSeeker){
        return interviewMapper.selectInterviewInfoIn(Integer.parseInt(interviewSeeker));
    }
}
